﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using WmsApp.WmsService;

namespace WmsApp.Service
{
    public class InStoreTypeService : IEntityService<InStoreType, InStoreTypeService>
    {

        #region IEntityService<Customer> Members

        public List<InStoreType> GetEntityList()
        {
            var sc = Factory.WmsServiceFactory.GetServiceClient();
            List<InStoreType> list = sc.GetInStoreTypes();
            foreach (var storeType in list)
            {
                storeType.BindPropertyChanged();
            }
            return list;
        }

        public List<InStoreType> GetEntityList(string condition)
        {
            throw new NotImplementedException();
        }

        public void SaveEntityList(List<InStoreType> list)
        {
            var sc = Factory.WmsServiceFactory.GetServiceClient();
            sc.SaveInStoreTypes(list);
            foreach (var c in list)
            {
                c.WcfEntityState = EntityState.Unchanged;
            }
        }

        public InStoreType GetEntity(string key)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
